home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / games / patsnp.txt < prev    next >
Text File  |  1989-01-09  |  4KB  |  116 lines

  1. Patching HSNIPES.COM - David Bennett
  2.  
  3. This file instructs you how to patch the HSNIPES.COM program found in this
  4. data library to work with a CGA/EGA display adapter.
  5.  
  6. Understanding the patch.
  7. ------------------------
  8.  
  9. If you have played SNIPES on a Novell network then you know there are to
  10. versions of the game. NSNIPES.EXE works on a workstation with a monographics
  11. adapter and NCSNIPES.EXE works with a CGA/EGA adapter.  If you run a
  12. comparison against these files you will notice that there is only one byte
  13. that is different.  Using the FC program distributed with some MS-DOS versions
  14. you get the output:
  15.  
  16. C>FC NCSNIPES.EXE NSNIPES.EXE
  17.  
  18. 000026c5: b8 b0
  19.  
  20. AHHA!  Anyone who is familiar with IBM PC video systems will right away
  21. recognize how easy it will be to patch the single-user version of snipes.  
  22. CGA adapters begin addressing video memory at B800:0000 like wise Monographic
  23. adapters use B000:0000 for their begining video address (This is the reason
  24. why you can have both a Mono and CGA monitor hooked up to your system at
  25. once).
  26.  
  27. Disassembling this area in the file NSNIPES.EXE we find.
  28.  
  29. 45B9:27C0 55            PUSH    BP
  30. 45B9:27C1 8BEC          MOV     BP,SP
  31. 45B9:27C3 B800B0        MOV     AX,B000      <--- This is where video memory
  32. 45B9:27C6 8EC0          MOV     ES,AX             is addressed.
  33. 45B9:27C8 8B7608        MOV     SI,[BP+08] 
  34. 45B9:27CB 8B7E06        MOV     DI,[BP+06]
  35. 45B9:27CE 8B4E04        MOV     CX,[BP+04]
  36.  
  37. So we need to look for similar code the the HSNIPES.COM file.  The string of
  38. bytes we are looking for is B8 00 B0 (Hex).  This translates into the machine
  39. language statment MOV AX,B000 which addresses monographic video memory.
  40.  
  41. Patching HSNIPES.COM
  42. --------------------
  43.  
  44. Now that we know what we are looking for in HSNIPES we can begin appling our
  45. patch.  You'll need to use DEBUG but don't worry I'll guide you right through
  46. it.  NOTE: The lines begining with *'s are comments.
  47.  
  48.  
  49. * First copy HSNIPES.COM to HCSNIPES.COM
  50.  
  51. COPY HSNIPES.COM HCSNIPES.COM
  52.  
  53. * Now debug HCSNIPES.COM
  54.  
  55. DEBUG HCSNIPES.COM
  56.  
  57. * First show the registers.   BX:CX will hold the length of the program.
  58.  
  59. -r
  60. AX=0000  BX=0000  CX=3DEC  DX=0000  SP=FFFE  BP=0000  SI=0000  DI=0000  
  61. DS=45DE  ES=45DE  SS=45DE  CS=45DE  IP=0100   NV UP EI PL NZ NA PO NC 
  62. 45DE:0100 FA            CLI                                       
  63.  
  64. * Now we know that we need to search through 3DEC bytes starting at 100h
  65. * (The begining of a COM file) for the code.
  66.  
  67. -s 100 l 3d3c b8 00 b0
  68. xxxx:27E3 
  69.  
  70. * We found the code at 27E3 (The xxxx will differ). If you have any other
  71. * number STOP HERE!!!
  72.  
  73. * First let's unassemble the code to make sure of what we're dealing with
  74.  
  75. -u 27d3
  76. 45DE:27D3 87410C        XCHG    AX,[BX+DI+0C]                      
  77. 45DE:27D6 C3            RET                                       
  78. 45DE:27D7 0000          ADD    [BX+SI],AL                         
  79. 45DE:27D9 0000          ADD    [BX+SI],AL                         
  80. 45DE:27DB 0000          ADD    [BX+SI],AL                         
  81. 45DE:27DD 0000          ADD    [BX+SI],AL                         
  82. 45DE:27DF 00558B        ADD    [DI-75],DL                         
  83. 45DE:27E2 EC            IN    AL,DX                              
  84. 45DE:27E3 B800B0        MOV    AX,B000        <---- * We'll change this to
  85. 45DE:27E6 8EC0          MOV    ES,AX                  be MOV AX,B800
  86. 45DE:27E8 8B7608        MOV    SI,[BP+08]                         
  87. 45DE:27EB 8B7E06        MOV    DI,[BP+06]                         
  88. 45DE:27EE 8B4E04        MOV    CX,[BP+04]                         
  89. 45DE:27F1 FC            CLD                                       
  90. 45DE:27F2 8A26860D      MOV    AH,[0D86]                          
  91.  
  92. * If you do not see this code in your disassembly then STOP NOW!!!
  93. * To make the change we need to change the byte at 27E5 from B0 to B8.
  94.  
  95. -e 27e5 b8
  96. * Right the patched file to the disk
  97.  
  98. -w
  99. Writing 3DEC bytes
  100.  
  101. * Quit DEBUG
  102.  
  103. -q
  104. Now loading HCSNIPES.COM on your computer should activate SNIPES on your
  105. CGA/EGA screen.  I hope this file has been usefull and informative in how to
  106. use debug to patch your programs.  If you have any questions please feel free
  107. to contact me via CompuServe or U.S. Mail
  108.  
  109. --------------------------------
  110. David Bennett
  111. Bennett Packaging of Kansas City
  112. 151 West Geospace Drive
  113. Independence, MO  64056
  114.  
  115. CompuServe: 74635,1671
  116.